package com.travelsky.airchina.boarding.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.travelsky.airchina.boarding.dao.ProductSeriesDAO;
import com.travelsky.airchina.boarding.domain.ProductSeries;
import com.travelsky.airchina.boarding.service.ProductSeriesService;


@Service("productSeriesService")
public class ProductSeriesServiceImpl implements ProductSeriesService{
	private ProductSeriesDAO productSeriesDAO;
	@Autowired
	public void setProductSeriesDao(ProductSeriesDAO productSeriesDao) {
		this.productSeriesDAO = productSeriesDao;
	}
	public void saveProductSeries(ProductSeries entity){
		productSeriesDAO.makePersistent(entity);
	}
	public ProductSeries getProductSeries(Long id){
		return productSeriesDAO.findById(id);
	}
	public List<ProductSeries> findProductSerieses(String status){
		return productSeriesDAO.findProductSerieses(status);
	}
	public List<ProductSeries> findProductSerieses(){
		return productSeriesDAO.findAll();
	}
	public void deleteProductSeries(Long id){
		productSeriesDAO.makeTransient(productSeriesDAO.findById(id));
	}
	public void updateProductSeriesStatus(Long id,String status){
		productSeriesDAO.updateProductSeriesStatus(id,status);
	}
}
